import { languages } from '@codemirror/language-data'
import { oneDark } from '@codemirror/theme-one-dark'

import { CrepeFeature, type CrepeFeatureConfig } from '../feature'
import { chevronDownIcon, clearIcon, editIcon, searchIcon, visibilityOffIcon } from '../icons'

export const defaultConfig: CrepeFeatureConfig = {
  [CrepeFeature.CodeMirror]: {
    theme: oneDark,
    languages,
    expandIcon: chevronDownIcon,
    searchIcon: searchIcon,
    clearSearchIcon: clearIcon,
    searchPlaceholder: '搜索语言',
    noResultText: '暂无匹配',
    previewToggleIcon: (previewOnlyMode) => (previewOnlyMode ? editIcon : visibilityOffIcon),
  },
  [CrepeFeature.Placeholder]: {
    text: '不积跬步，无以至千里......',
    mode: 'block',
  },
  [CrepeFeature.BlockEdit]: {
    slashMenuTextGroupLabel: '文本',
    slashMenuTextLabel: '文本',
    slashMenuH1Label: '一级标题',
    slashMenuH2Label: '二级标题',
    slashMenuH3Label: '三级标题',
    slashMenuH4Label: '四级标题',
    slashMenuH5Label: '五级标题',
    slashMenuH6Label: '六级标题',
    slashMenuQuoteLabel: '引用',
    slashMenuDividerLabel: '分割线',
    slashMenuListGroupLabel: '列表',
    slashMenuBulletListLabel: '无序列表',
    slashMenuOrderedListLabel: '有序列表',
    slashMenuTaskListLabel: '任务列表',
    slashMenuAdvancedGroupLabel: '高级',
    slashMenuImageLabel: '图片',
    slashMenuCodeBlockLabel: '代码块',
    slashMenuTableLabel: '表格',
    slashMenuMathLabel: '公式',
  },
}
